With the advancement of technology and the rapid adoption of smartphones and tablet PCs, the pixels of the built-in camera modules in smartphones and tablet PCs are increasing in number. Therefore, people usually only carry out smartphone or tablet to meet their photography requirements. Even so, there are still some shortcomings. For example, to find an appropriate view, people usually need to adjust the direction and position of the smartphone or tablet. For example, when the smartphone or tablet PC is upright, people cannot take a panorama photograph and thus people need to get the smartphone or tablet horizontal to do so. In view of this, the present disclosure provides an electronic device with a photographing function and a corresponding photographing method to resolve the above problem.